package entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class PersonalData extends BaseEntity {
	private String hkID;
	private String lastName;
	private String firstName;
	private Date birthDay;
	private String contactADDR;
	private int contactNo;
	private String gender;

	public PersonalData(String string) throws ParseException {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-mm-dd");

		String[] attrVal = string.split(" ");
		this.setHkID(attrVal[0]);
		this.setLastName(attrVal[1]);
		this.setFirstName(attrVal[2]);
		this.birthDay = formatter.parse(attrVal[3]);
		this.setContactADDR(attrVal[4]);
		this.contactNo = Integer.parseInt(attrVal[5]);
		this.setGender(attrVal[6]);
	}

	public PersonalData(String hkID2, String lastName2, String firstName2,Date birthDay2, String contactADDR2, int contactNo2, String gender2) {
		this.setHkID(hkID2);
		this.setLastName(lastName2);
		this.setFirstName(firstName2);
		this.setBirthDay(birthDay2);
		this.setContactADDR(contactADDR2);
		this.setContactNo(contactNo2);
		this.setGender(gender2);
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getHkID() {
		return hkID;
	}

	public void setHkID(String hkID) {
		this.hkID = hkID;
	}

	public int getContactNo() {
		return contactNo;
	}

	public void setContactNo(int contactNo) {
		this.contactNo = contactNo;
	}

	public String getContactADDR() {
		return contactADDR;
	}

	public void setContactADDR(String contactADDR) {
		this.contactADDR = contactADDR;
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}
}
